using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PACKETPARSERMAX20.CORE
{
	public class player_classlevelstats : MangosBase
	{
		public System.Byte? class_;
		public System.Byte? level;
		public System.UInt16? basehp;
		public System.UInt16? basemana;




		public override string GetInsertCommand()
		{
			return string.Format("INSERT IGNORE INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES ('{0}', '{1}', '{2}', '{3}');", class_.GetValueOrDefault(), level.GetValueOrDefault(), basehp.GetValueOrDefault(), basemana.GetValueOrDefault());
		}


		public override string GetUpdateCommand()
		{
            StringBuilder sb = new StringBuilder();
						sb.Append("UPDATE `player_classlevelstats` SET ");
			if(level != null)
			{
				sb.AppendLine("`level`='" + level.Value.ToString() + "'");
			}
			if(basehp != null)
			{
				sb.AppendLine("`basehp`='" + basehp.Value.ToString() + "'");
			}
			if(basemana != null)
			{
				sb.AppendLine("`basemana`='" + basemana.Value.ToString() + "'");
			}
				sb = sb.Replace("\r\n", ", ");
                sb.Append(" WHERE `class`='" + class_.Value.ToString() + "';");
				sb = sb.Replace(",  WHERE", " WHERE");

            return sb.ToString();
		}


	}
}
